*Histograms of cash and overdrafts in consumption days

**********************************************************
*Figure 1: Co-holding Deposit Account Balances and Overdraft Balances
* 1B: Overdraft Balances 
**********************************************************	

recode cons1 (300.00000001/100000000 = 350), gen(cons1_cat)
recode od_exp (100.00000001/10000000000 = 125), gen(od_exp_cat)

recode cons1_HH (300.00000001/100000000 = 350), gen(cons1_HH_cat)
recode od_exp_HH (100.00000001/10000000000 = 125), gen(od_exp_HH_cat)

*Histogram od_exp, high values winsorized at 10% level, without labels
hist  od_exp_cat, frac width(10) ///
fcolor(blue) lwidth(medium) lcolor(black) ///
title("Fraction of observations", place(left) size(large)) ///
ytitle("") ///
xtitle("Overdraft holdings in consumption days", size(large)) ///
ylabel(, labsize(medium) angle(0) format(%9.1fc)) ///
xlabel(0 50 100 125 ">100", labsize(medium)) 
graph export "Figures/Histogramod_expW10WL.pdf", replace
graph export "Figures/Histogramod_expW10WL.png", replace


**********************************************************
*Figure 1: Co-holding Deposit Account Balances and Overdraft Balances
* 1C: Cash Balances  
**********************************************************	

*Histogram cons1, high values winsorized at 10% level, without labels
hist  cons1_cat, frac width(30) ///
fcolor(blue) lwidth(medium) lcolor(black) ///
title("Fraction of observations", place(left) size(large)) ///
ytitle("") ///
xtitle("Cash holdings in consumption days", size(large)) ///
ylabel(, labsize(medium) angle(0) format(%9.1fc)) ///
xlabel(0 100 200 300 350 ">300", labsize(medium))
graph export "Figures/Histogramcons1W10WL.pdf", replace
graph export "Figures/Histogramcons1W10WL.png", replace



**********************************************************
*Figure A1: Distributions of Deposit Balances and Overdraft Balances
* A1-A: Single Individuals - Cash
* A1-B: Single Individuals - Overdraft 
**********************************************************	

*Histogram cons1, high values winsorized at 10% level, without labels
hist  cons1_cat if alwaysin2memberhh==0, frac width(30) ///
fcolor(blue) lwidth(medium) lcolor(black) ///
title("Fraction of observations", place(left) size(large)) ///
ytitle("") ///
xtitle("Cash holdings in consumption days", size(large)) ///
ylabel(, labsize(medium) angle(0) format(%9.1fc)) ///
xlabel(0 100 200 300 350 ">300", labsize(medium))
graph export "Figures/Histogramcons1SW10WL.pdf", replace
graph export "Figures/Histogramcons1SW10WL.png", replace

*Histogram od_exp, high values winsorized at 10% level, without labels
hist  od_exp_cat if alwaysin2memberhh==0, frac width(10) ///
fcolor(blue) lwidth(medium) lcolor(black) ///
title("Fraction of observations", place(left) size(large)) ///
ytitle("") ///
xtitle("Overdraft holdings in consumption days", size(large)) ///
ylabel(, labsize(medium) angle(0) format(%9.1fc)) ///
xlabel(0 50 100 125 ">100", labsize(medium)) 
graph export "Figures/Histogramod_expSW10WL.pdf", replace
graph export "Figures/Histogramod_expSW10WL.png", replace



**********************************************************
*Figure A1: Distributions of Deposit Balances and Overdraft Balances
* A1-C: Linked Individuals - Cash
* A1-D: Linked Individuals - Overdraft 
**********************************************************	

*Histogram cons1, high values winsorized at 10% level, without labels
hist  cons1_cat if alwaysin2memberhh==1, frac width(30) ///
fcolor(blue) lwidth(medium) lcolor(black) ///
title("Fraction of observations", place(left) size(large)) ///
ytitle("") ///
xtitle("Cash holdings in consumption days", size(large)) ///
ylabel(, labsize(medium) angle(0) format(%9.1fc)) ///
xlabel(0 100 200 300 350 ">300", labsize(medium))
graph export "Figures/Histogramcons1LW10WL.pdf", replace
graph export "Figures/Histogramcons1LW10WL.png", replace

*Histogram od_exp, high values winsorized at 10% level, without labels
hist  od_exp_cat if alwaysin2memberhh==1, frac width(10) ///
fcolor(blue) lwidth(medium) lcolor(black) ///
title("Fraction of observations", place(left) size(large)) ///
ytitle("") ///
xtitle("Overdraft holdings in consumption days", size(large)) ///
ylabel(, labsize(medium) angle(0) format(%9.1fc)) ///
xlabel(0 50 100 125 ">100", labsize(medium)) 
graph export "Figures/Histogramod_expLW10WL.pdf", replace
graph export "Figures/Histogramod_expLW10WL.png", replace



**********************************************************
*Figure A1: Distributions of Deposit Balances and Overdraft Balances
* A1-E: Couples - Cash
* A1-F: Couples - Overdraft 
**********************************************************	

*Histogram cons1_HH, high values winsorized at 10% level, without labels
hist  cons1_HH_cat if alwaysin2memberhh ==1, frac width(30) ///
fcolor(blue) lwidth(medium) lcolor(black) ///
title("Fraction of observations", place(left) size(large)) ///
ytitle("") ///
xtitle("Cash holdings in consumption days", size(large)) ///
ylabel(, labsize(medium) angle(0) format(%9.1fc)) ///
xlabel(0 100 200 300 350 ">300", labsize(medium))
graph export "Figures/Histogramcons1HHW10WL.png", width(1800) height(1300) replace
graph export "Figures/Histogramcons1HHW10WL.pdf", replace

*Histogram od_exp_HH, high values winsorized at 10% level
hist  od_exp_HH_cat if alwaysin2memberhh ==1, frac width(15) ///
fcolor(blue) lwidth(medium) lcolor(black) ///
title("Fraction of observations", place(left) size(large)) ///
ytitle("") ///
xtitle("Overdraft holdings in consumption days", size(large)) ///
ylabel(, labsize(medium) angle(0) format(%9.1fc)) ///
xlabel(0 50 100 125 ">100", labsize(medium)) 
graph export "Figures/Histogramod_expHHW10WL.png", width(1800) height(1300) replace
graph export "Figures/Histogramod_expHHW10WL.pdf", replace


********************************************************************************
*Delete again
drop cons1_cat cons1_HH_cat od_exp_cat od_exp_HH_cat
